<?php	
	require '../utils/conn.php';
	$category = $_REQUEST['category'];
	$letters = array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z");
	$jsonStr = "";
	for ($i = 0; $i < count($letters); $i++) {
		$letter = $letters[$i];
		$query = "SELECT MAX(create_time) FROM main_word WHERE word_index ='$letter' AND category=$category";
		$result = mysql_query($query);
		$row = mysql_fetch_array($result, MYSQL_ASSOC);
		if ($i == 0){
			$jsonStr = "\"$letter\":\"".$row['MAX(create_time)']."\"";
		}else {
			$jsonStr = $jsonStr.",\"$letter\":\"".$row['MAX(create_time)']."\"";
		}
	}
	$jsonStr = "{\"letters\":{".$jsonStr."}}";
	echo $jsonStr;
?>